<?php
/**
 *APINAME:
 *Developer:
 *Complete:
 */

namespace app\common\controller;


class Baidu_ip
{
    //百度ip接口
    public static function baidu_ip()
    {
        $ak = env('BAIDU_AK');
        $url = file_get_contents("http://api.map.baidu.com/location/ip?ak=$ak");
        $res1 = json_decode($url,true);
        if ($res1) {
            return json(array("status" => 1, "msg" => "查询成功", "result" => $res1));
        } else {
            return json(array("status" => -1, "msg" => "查询失败"));
        }
    }
}